﻿package com.gambit.happilyeverafter.characters {
	import org.flixel.FlxSprite;
	/**
	 * ...
	 * @author William Hutama
	 */
	public class Knight extends BaseCharacter {
		[Embed(source = "../../../../data/small/knight_small.png")]
		private var KnightImage:Class;
		
		public function Knight(x:Number, y:Number) {
			super(KnightImage, x, y);
			
			_move_speed = 700;
			maxVelocity.x = 150;
			maxVelocity.y = 200;
			health = 10;
			
			acceleration.y = 500;
			drag.x = 500;
			width = 32;
			height = 32;
			
			addAnimation("walk", [0], 10);
			addAnimation("stopped", [0], 10);
		}
		
		override public function update():void {
			if (velocity.x == 0) {
				play("stopped");
			}
			else {
				play("walk");
			}
			
			super.update();
		}
	}

}